package jdbc;

/*
 * ----Create a basic JDBC application----
 * 1.Register a driver
 *   ע��ǰȷ���Ѿ���װ�˶�Ӧ����.jar�ļ���
 *   ����ע�᷽����
 *   	1)new
 *   	2)manager
 *   	3)reflect��Class.forName()
 * 2.Establish a connection to the database
 * 		===============================================================
 * 			Connection con = DriverManager.getConnection(
 * 						"jdbc:oracle:thin:@10.10.3.237:1521:tarena", 
 * 						"openlab","open123");
 * 		===============================================================
 * 3.Create a statement
 * 		=========================================================
 * 			Statement stm = con.createStatement();
 * 		=========================================================
 * 4.Excute a SQL
 * 		=========================================================
 * 			String sql = "select * from rock_stu";
 *			ResultSet rs = st.executeQuery(sql);
 * 		=========================================================
 * 5.Process the results
 * 	 ���ķ������ؽ��ֻ�ܵ��һ�Σ����ResultSet��ĩβʱ�޷���ز�
 * 		=====================================================================
 * 			while (rs.next()) {
 * 				System.out.print("id=" + rs.getInt("id"));
 * 				System.out.print(",  name=" + rs.getString("name"));
 * 				System.out.println(",  birthday=" + rs.getDate("birthday"));
 * 			}
 * 		=====================================================================
 * 6.close all
 * 		====================================================
 * 			finally {
 * 				try {rs.close();} catch (Exception e) {}
 * 				try {st.close();} catch (Exception e) {}
 * 				try {con.close();} catch (Exception e) {}
 * 			}
 * 		====================================================
 */

public class TestJDBC {
    public static void main(String[] args) {

    }

}
